package cn.imnaer.service.rpc.enums;

/**
 * 收藏夹类型
 * Created by Administrator on 2015/5/6.
 */
public enum EnumCollectType {

    SCENIC("SCENIC", " SCENIC"),
    TRAVEL_NOTE("TRAVEL_NOTE", "TRAVEL_NOTE"),
    TRAVEL_NOTE_PHOTO("TRAVEL_NOTE_PHOTO", "TRAVEL_NOTE_PHOTO"),
    SHARE_PHOTO("SHARE_PHOTO", "SHARE_PHOTO"),
    SHARE_PHOTO_ITEM("SHARE_PHOTO_ITEM", "SHARE_PHOTO_ITEM");
    private String title;
    private String value;

    private EnumCollectType(String title, String value) {
        this.title = title;
        this.value = value;
    }

    /**     * 解析值为当前枚举
     *
     * @param value
     * @return
     */
    public static EnumCollectType parseValue(String value) {
        if (value.equals("SCENIC")) {
            return EnumCollectType.SCENIC;
        }
        if (value.equals("TRAVEL_NOTE")) {
            return EnumCollectType.TRAVEL_NOTE;
        }
        if (value.equals("TRAVEL_NOTE_PHOTO")) {
            return EnumCollectType.TRAVEL_NOTE_PHOTO;
        }
        if (value.equals("SHARE_PHOTO_ITEM")) {
            return EnumCollectType.SHARE_PHOTO_ITEM;
        }
        if (value.equals("SHARE_PHOTO")) {
            return EnumCollectType.SHARE_PHOTO;
        }
        return null;
    }


    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
